<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><title>Module: ApplicationHelper</title><link type="text/css" href=".././rdoc-style.css" rel="stylesheet" media="screen"/><script type="text/javascript">
// Allison template
// Copyright 2007, 2008 Cloudburst, LLC. Licensed under the AFL 3. See the included LICENSE file.

var href_base = '.././rdoc-style.css'.replace(/(.*\/).*/, '$1'); // inline js is good for something  

function $(id) {
    if (document.getElementById)
      elem = document.getElementById(id);
    else if ( document.all )
      elem = eval("document.all." + id);
    else
      return false;
    return elem;
}

  function toggle(id) {
    elem = $(id);
    elemStyle = elem.style;   
    if (elemStyle.display == "block") {
      elemStyle.display = "none"
    } else {
      elemStyle.display = "block"
    }
    return true;
  }

  function toggleText(id) {
    elem = $(id)
    if (m = elem.innerHTML.match(/(Hide)(.*)/)) {
      elem.innerHTML = "Show" + m[2];
    } else if (m = elem.innerHTML.match(/(Show)(.*)/)) {
      elem.innerHTML = "Hide" + m[2];
    }
    return true;
  }

function span(s, klass) {
  return '<span class="' + klass + '">' + s + '</span>';
}
  
function highlightSymbols() {
  pres = document.getElementsByTagName('pre');
  for(var i = 0; i < pres.length; i++) {
    pre = pres[i];
    spans = pre.getElementsByTagName('span');
    for(var k = 0; k < spans.length; k++) {
      span = spans[k];
      if (span.className.match(/ruby-identifier/)) {
        if (span.innerHTML.match(/^:/)) {
          span.className += " ruby-symbol";
        }
      }
    }
  }
}

 function hasClass(obj) {
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
  }   

 function stripe() {
    var even = true;
    var color = "#e4ebed";
    var tables = document.getElementsByTagName('table');
    if (tables.length == 0) { return; }
    for (var h = 0; h < tables.length; h++) {
        var trs = tables[h].getElementsByTagName("tr");
        for (var i = 0; i < trs.length; i++) {
          var tds = trs[i].getElementsByTagName("td");
            for (var j = 0; j < tds.length; j++) {       
              if (hasClass(tds[j]) != "first") {                
              var mytd = tds[j];
              if (even) {
                mytd.style.backgroundColor = color;
              }         
            }
          }
          even =  ! even;
      }
    }
  }
  
function ajaxGet(url) {
  url = (href_base + url).replace('/./', '/')
  var req = false;

  if (window.ActiveXObject) {
    try {
      // stupid hack because IE7 disables local Ajax with the native xmlhttprequest object
      // for security purposes. Yet ActiveX still works. Thanks, Microsoft. I hate you. Die.
      req = new ActiveXObject("MSXML2.XMLHTTP.3.0");
    } catch (e) {
      try {
        /* IE 6 and maybe 5, don't know, don't care */
        req = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
        try {
          req = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {
          req = false;
        }
      }
    }
  }
    
  /* real browsers */
  if (!req && window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } 
  
  if (req) {
    req.open('GET', url, false);
    req.send(null);
    return req.responseText;
  } else {
    return "Ajax error";  
  }
}


function addEvent(elm, evType, fn, useCapture) {
	if (elm.addEventListener) {
	  elm.addEventListener(evType, fn, useCapture);  
  	return true;
	} else if (elm.attachEvent) {
  	var r = elm.attachEvent('on' + evType, fn);  
	  return r;  
	} else {
  	elm['on' + evType] = fn;
	}
}

function insertIndices() {
  pages = ["class", "file", "method"]
  for (x in pages) { 
    $(pages[x]).innerHTML += ajaxGet('fr_' + pages[x] + '_index.html').replace(/(href=")/g, '$1' + href_base);
  }
  /* mouseoverify method links */
  links = $('method').getElementsByTagName('a');
  for (var x = 0; x < links.length; x++) {
    if (m = links[x].innerHTML.match(/(.*)\s\((.*)\)/)) {
      links[x].innerHTML = m[1] + '<br>';
      links[x].title = m[2];
    }
  }
  /* this is stupid */
  $('class').style.display = "block";
  $('file').style.display = "block";
  
  /* has to be here because IE7 does not guarantee the onLoad callback order */
  abbreviateIndicesInner(["class", "file"], 25, "a");
  /* same, linkTitle() depends on the class link list */
  linkTitle();
}

function abbreviateIndices() {
  var ids = ["defined_in", "child_of", "includes", "requires", "method", "methods"];
  abbreviateIndicesInner(ids, 25, 'a');
  abbreviateIndicesInner(ids, 25, 'span');
}

function abbreviateIndicesInner(indices, amount, tag) {
  for (var x = 0; x < indices.length; x++) { 
    var the_index = $(indices[x]);
    if (the_index) {
      links = the_index.getElementsByTagName(tag);
      for (var y = 0; y < links.length; y++) {
        var link = links[y];
        if (link.getElementsByTagName('span').length == 0 && link.getElementsByTagName('a').length == 0) {
          // avoid nesting
          link.innerHTML = link.innerHTML.replace(/<br>|\n/gi, '');
          link.title = link.innerHTML;
          link.innerHTML = abbreviate(link.innerHTML, amount) + '<br>';
        }
      }
    }
  }
}

function linkTitle() {
  
  /* grab the correct title element from the index */
  var index_page = ajaxGet('index.html');
  title_text = index_page.match(/<title>(.*)<\/title>/m)[1];
  document.title = title_text + " - " + document.title;
  var p = $('header').getElementsByTagName('p')[0]
  if (p.innerHTML.match(/^\s*$/)) {
    p.innerHTML = title_text;
  } else {
    p.innerHTML = title_text + ": " + p.innerHTML;
  }
  
  /* set the link properly */
  title_link = index_page.match(/<a\s+href="(.*?)"/)[1];
  var element = $('title');
  var item_type = "";
  var item_name = "";
  if (m = element.innerHTML.match(/(Class:|Module:|File:)\s*(.*)/)) {
    item_type = m[1];
    item_name = m[2];
  } else {
    item_name = element.innerHTML;
  }
  element.innerHTML = '<a href="' + href_base + title_link + '">' + item_type + " " + abbreviate(item_name, 45) + '</a>';
  element.getElementsByTagName('a')[0].title = item_name
  
  /* breadcrumb navigation */
  items = item_name.split("::");
  items_new = item_name.split("::");
  file_links = $('class').getElementsByTagName('a');
  for (var x = 0; x < items.length - 1; x++ ){
    var item = items[x];
    link = ("/classes/" + items.slice(0,x).join("/") + "/" + item + ".html").replace('//', '/');
    regex = new RegExp(RegExp.escape(link) + '$');
    for (var y = 0; y < file_links.length; y++) {
      if (file_links[y].href.match(regex)) {
         items_new[x] = '<a href="' + href_base + link + '">' + item + '</a>';
         break;
      }
    }  
  }
  $('item_name').innerHTML = item_type + ' ' + items_new.join(" :: ");
}

function abbreviate(s, size) {
  while (s.length > size) {
    var old_s = s;
    s = s.replace(/\s|\n/mg, '');
    s = s.replace(/([A-Z])[a-z]+/m, '$1');
    if (!s || old_s == s) {
      return "..." + s.substring(s.length - size, s.length);
    }
  }
  return s;
}

function disableSubmit(event) {
  var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
  if (keyCode == 13) {
    return false;
  } else {
    return true;
  }
}
  
function filterList(id, s, event) {
  
  /* some weak escaping */
  s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, '');
  s = RegExp.escape(s);
  
  var show_all = false;
  if (s.match(/^\s*$/)) {
    show_all = true;
  }
  
  links = $(id).getElementsByTagName('a')
  regex = new RegExp(s, 'i');
  
  for (var x = 0; x < links.length; x++) {
    var link = links[x];
    if (show_all) {
      link.style.display = 'inline';
    } else {
       if (link.innerHTML.match(regex)) {        
         link.style.display = 'inline';
       } else {
         link.style.display = 'none';
       }
    }
  }
  return true;
}

RegExp.escape = function(text) {
  if (!arguments.callee.sRE) {
    var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'];
    arguments.callee.sRE = new RegExp(
      '(\\' + specials.join('|\\') + ')', 'g'
    );
  }
  return text.replace(arguments.callee.sRE, '\\$1');
}

function hacks() {
  // show the spacer if necessary, 
  divs = document.getElementsByTagName('div');
  for(var x = 0; x < divs.length; x++) {
    if (divs[x].className && divs[x].className.match(/top/)) {
      document.getElementById('spacer').style.display = 'block';
    }
  }
  // remove extra colons from tables
  tds = document.getElementsByTagName('td');
  for(var x = 0; x < tds.length; x++) {
    str = tds[x].innerHTML
    if (str.charAt(str.length - 1) == ":") {
      tds[x].innerHTML = str.slice(0, str.length - 1)
    }
  }
}

addEvent(window, 'load', insertIndices, false);
addEvent(window, 'load', abbreviateIndices, false);
addEvent(window, 'load', stripe, false);
addEvent(window, 'load', highlightSymbols, false);
addEvent(window, 'load', hacks, false);
</script></head><body><div id="container"><div class="curve" id="preheader_curve_0"></div><div class="curve" id="preheader_curve_1"></div><div class="curve" id="preheader_curve_2"></div><div class="curve" id="preheader_curve_3"></div><div class="curve" id="preheader_curve_4"></div><div class="curve" id="preheader_curve_5"></div><div id="header"><p>
</p><span><h1 id="title">
Module: ApplicationHelper
</h1></span></div><div class="clear"></div><div id="left">

<div class="navigation darker top" id="defined_in"><h3>Defined in</h3>

<a href="../files/app/helpers/application_helper_rb.html">app/helpers/application_helper.rb</a>

</div>



<div class="navigation top" id="methods"><h3>Methods</h3>


<a href='#M000085'>
bank_account_image<br/>
</a>




<a href='#M000083'>
default_listing_image_path<br/>
</a>




<a href='#M000086'>
funding_bar_for<br/>
</a>




<a href='#M000084'>
homeowner_image<br/>
</a>




<a href='#M000090'>
page_title<br/>
</a>




<a href='#M000091'>
partial<br/>
</a>




<a href='#M000088'>
pct<br/>
</a>




<a href='#M000089'>
percentage<br/>
</a>




<a href='#M000087'>
percentage_bar<br/>
</a>




<a href='#M000082'>
prosper_image_url<br/>
</a>




<a href='#M000081'>
prosper_listing_url<br/>
</a>


</div>
<div id="spacer"></div><div class="navigation darker index" id="class_wrapper"><div class="list_header"><h3>All classes</h3></div><div class="list_header_link"><a href="#" onclick="toggle('class'); toggleText('class_link'); return false;" id="class_link">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:&nbsp;&nbsp;</label><input type="text" onKeyUp="return filterList('class', this.value, event);" id="filter_class" onKeyPress="return disableSubmit(event);"></input></form></div></div><div class="navigation darker index" id="file_wrapper"><div class="list_header"><h3>All files</h3></div><div class="list_header_link"><a href="#" onclick="toggle('file'); toggleText('file_link'); return false;" id="file_link">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:&nbsp;&nbsp;</label><input type="text" onKeyUp="return filterList('file', this.value, event);" id="filter_file" onKeyPress="return disableSubmit(event);"></input></form></div></div><div class="navigation darker index" id="method_wrapper"><div class="list_header"><h3>All methods</h3></div><div class="list_header_link"><a href="#" onclick="toggle('method'); toggleText('method_link'); return false;" id="method_link">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:&nbsp;&nbsp;</label><input type="text" onKeyUp="return filterList('method', this.value, event);" id="filter_method" onKeyPress="return disableSubmit(event);"></input></form></div></div></div><div id="content">
<h1 id="item_name">Module: ApplicationHelper</h1>

<div id="description"><p>
Methods added to this helper will be available to all templates in the
application.
</p>
</div>




<p></p>






<h1>Public Instance Methods</h1>


<a class="small" name="M000085"><br/></a>
<div class="method_block"><h3>
<a href='#M000085'>


bank_account_image

(which)

</a>
</h3>
<p>
Makes an image tag showing whether a bank account is verified
</p>

<p class="source_link" id="M000085-show-link"><a href="#" onclick="toggle('M000085-source'); toggleText('M000085-link'); return false;" id="M000085-link">Show source...</a></p><div class="source" id="M000085-source"><pre>    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 29</span>
29:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bank_account_image</span>(<span class="ruby-identifier">which</span>)
30:     <span class="ruby-identifier">which</span> = <span class="ruby-identifier">which</span> <span class="ruby-value">? </span><span class="ruby-value str">'yes'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'no'</span>
31:     <span class="ruby-identifier">image_tag</span> <span class="ruby-node">&quot;http://www.prosper.com/images/icons/account_verified_#{which}.gif&quot;</span>, <span class="ruby-identifier">:title</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;Bank account verified&quot;</span>, <span class="ruby-identifier">:alt</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;Bank account verified&quot;</span>
32:   <span class="ruby-keyword kw">end</span></pre></div>
</div>

<a class="small" name="M000083"><br/></a>
<div class="method_block"><h3>
<a href='#M000083'>


default_listing_image_path

()

</a>
</h3>
<p>
The image used if a listing has no image
</p>

<p class="source_link" id="M000083-show-link"><a href="#" onclick="toggle('M000083-source'); toggleText('M000083-link'); return false;" id="M000083-link">Show source...</a></p><div class="source" id="M000083-source"><pre>    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 17</span>
17:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_listing_image_path</span>
18:     <span class="ruby-value str">'http://www.prosper.com/images/icons/listingnoimagefound.gif'</span>
19:   <span class="ruby-keyword kw">end</span></pre></div>
</div>

<a class="small" name="M000086"><br/></a>
<div class="method_block"><h3>
<a href='#M000086'>


funding_bar_for

(posting)

</a>
</h3>
<p>
Makes an image that is wide based on <a
href="ApplicationHelper.html#M000089">percentage</a>, using a
posting&#8216;s percent funded
</p>

<p class="source_link" id="M000086-show-link"><a href="#" onclick="toggle('M000086-source'); toggleText('M000086-link'); return false;" id="M000086-link">Show source...</a></p><div class="source" id="M000086-source"><pre>    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 35</span>
35:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">funding_bar_for</span>(<span class="ruby-identifier">posting</span>)
36:     <span class="ruby-identifier">percentage_bar</span>(<span class="ruby-identifier">posting</span>.<span class="ruby-identifier">percent_funded</span>)
37:   <span class="ruby-keyword kw">end</span></pre></div>
</div>

<a class="small" name="M000084"><br/></a>
<div class="method_block"><h3>
<a href='#M000084'>


homeowner_image

(which)

</a>
</h3>
<p>
Makes an image tag showing whether the user owns a home
</p>

<p class="source_link" id="M000084-show-link"><a href="#" onclick="toggle('M000084-source'); toggleText('M000084-link'); return false;" id="M000084-link">Show source...</a></p><div class="source" id="M000084-source"><pre>    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 22</span>
22:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">homeowner_image</span>(<span class="ruby-identifier">which</span>)
23:     <span class="ruby-identifier">which</span> = <span class="ruby-identifier">which</span> <span class="ruby-value">? </span><span class="ruby-value str">&quot;yes&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;no&quot;</span>
24:     <span class="ruby-identifier">owns</span> = <span class="ruby-identifier">which</span> <span class="ruby-value">? </span><span class="ruby-value str">&quot;homeowner&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;renter&quot;</span>
25:     <span class="ruby-identifier">image_tag</span> <span class="ruby-node">&quot;http://www.prosper.com/images/icons/homeowner_#{which}_sm.gif&quot;</span>, <span class="ruby-identifier">:title</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{owns}&quot;</span>, <span class="ruby-identifier">:alt</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">owns</span>
26:   <span class="ruby-keyword kw">end</span></pre></div>
</div>

<a class="small" name="M000090"><br/></a>
<div class="method_block"><h3>
<a href='#M000090'>


page_title

(title_text=nil)

</a>
</h3>
<p>
Sets and adds DangerLabs to the page title
</p>

<p class="source_link" id="M000090-show-link"><a href="#" onclick="toggle('M000090-source'); toggleText('M000090-link'); return false;" id="M000090-link">Show source...</a></p><div class="source" id="M000090-source"><pre>    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 63</span>
63:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">page_title</span>(<span class="ruby-identifier">title_text</span>=<span class="ruby-keyword kw">nil</span>)
64:     <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@page_title</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">title_text</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@page_title</span>
65:     <span class="ruby-ivar">@page_title</span> = <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">title_text</span>.<span class="ruby-identifier">blank?</span>
66:       <span class="ruby-value str">&quot;DangerLabs Grouper&quot;</span>
67:     <span class="ruby-keyword kw">else</span>
68:       <span class="ruby-node">&quot;DangerLabs Grouper - #{title_text}&quot;</span>
69:     <span class="ruby-keyword kw">end</span>
70:   <span class="ruby-keyword kw">end</span></pre></div>
</div>

<a class="small" name="M000091"><br/></a>
<div class="method_block"><h3>
<a href='#M000091'>


partial

(template, locals={}, &amp;block)

</a>
</h3>

<p class="source_link" id="M000091-show-link"><a href="#" onclick="toggle('M000091-source'); toggleText('M000091-link'); return false;" id="M000091-link">Show source...</a></p><div class="source" id="M000091-source"><pre>    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 72</span>
72:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">partial</span>(<span class="ruby-identifier">template</span>, <span class="ruby-identifier">locals</span>={}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
73:     <span class="ruby-identifier">inner_content</span> = <span class="ruby-identifier">block_given?</span> <span class="ruby-value">? </span><span class="ruby-identifier">capture</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
74:     
75:     <span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">locals</span> <span class="ruby-comment cmt"># lets us use a default style when we just need to pass one object</span>
76:     <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Hash</span>
77:       <span class="ruby-identifier">locals</span>[<span class="ruby-identifier">:inner_content</span>] = <span class="ruby-identifier">inner_content</span>
78:       <span class="ruby-identifier">render</span> <span class="ruby-identifier">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">template</span>, <span class="ruby-identifier">:locals</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">locals</span>
79:     <span class="ruby-keyword kw">else</span>
80:       <span class="ruby-identifier">render</span> <span class="ruby-identifier">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">template</span>, <span class="ruby-identifier">:object</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">locals</span>
81:     <span class="ruby-keyword kw">end</span>
82:     
83:     <span class="ruby-comment cmt">#if a block is given, we concat automatically because of ERB's limitations</span>
84:     <span class="ruby-comment cmt">#otherwise, &lt;%= needs to be used</span>
85:     <span class="ruby-identifier">concat</span>(<span class="ruby-identifier">result</span>, <span class="ruby-identifier">block</span>.<span class="ruby-identifier">binding</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
86:     <span class="ruby-identifier">result</span>
87:   <span class="ruby-keyword kw">end</span></pre></div>
</div>

<a class="small" name="M000088"><br/></a>
<div class="method_block"><h3>
<a href='#M000088'>


pct

(number, precision = 0)

</a>
</h3>
<p>
Formats a number as a <a
href="ApplicationHelper.html#M000089">percentage</a>
</p>

<p class="source_link" id="M000088-show-link"><a href="#" onclick="toggle('M000088-source'); toggleText('M000088-link'); return false;" id="M000088-link">Show source...</a></p><div class="source" id="M000088-source"><pre>    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 45</span>
45:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pct</span>(<span class="ruby-identifier">number</span>, <span class="ruby-identifier">precision</span> = <span class="ruby-value">0</span>)
46:     <span class="ruby-keyword kw">if</span> (<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">100</span>).<span class="ruby-identifier">include?</span> <span class="ruby-identifier">number</span>
47:       <span class="ruby-node">&quot;%.#{precision}f&quot;</span> <span class="ruby-operator">%</span> (<span class="ruby-identifier">number</span> <span class="ruby-operator">*</span> <span class="ruby-value">100</span>)
48:     <span class="ruby-keyword kw">else</span>
49:       <span class="ruby-keyword kw">nil</span>
50:     <span class="ruby-keyword kw">end</span>
51:   <span class="ruby-keyword kw">end</span></pre></div>
</div>

<a class="small" name="M000089"><br/></a>
<div class="method_block"><h3>
<a href='#M000089'>


percentage

(number, precision = 0)

</a>
</h3>
<p>
Formats a number as a <a
href="ApplicationHelper.html#M000089">percentage</a>, or n/a if not a
number
</p>

<p class="source_link" id="M000089-show-link"><a href="#" onclick="toggle('M000089-source'); toggleText('M000089-link'); return false;" id="M000089-link">Show source...</a></p><div class="source" id="M000089-source"><pre>    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 54</span>
54:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">percentage</span>(<span class="ruby-identifier">number</span>, <span class="ruby-identifier">precision</span> = <span class="ruby-value">0</span>)
55:     <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span> = <span class="ruby-identifier">pct</span>(<span class="ruby-identifier">number</span>, <span class="ruby-identifier">precision</span>)
56:       <span class="ruby-node">&quot;#{value}%&quot;</span>
57:     <span class="ruby-keyword kw">else</span>
58:       <span class="ruby-value str">'n/a'</span>
59:     <span class="ruby-keyword kw">end</span>
60:   <span class="ruby-keyword kw">end</span></pre></div>
</div>

<a class="small" name="M000087"><br/></a>
<div class="method_block"><h3>
<a href='#M000087'>


percentage_bar

(percent)

</a>
</h3>
<p>
Makes an image that is wide based on <a
href="ApplicationHelper.html#M000089">percentage</a>
</p>

<p class="source_link" id="M000087-show-link"><a href="#" onclick="toggle('M000087-source'); toggleText('M000087-link'); return false;" id="M000087-link">Show source...</a></p><div class="source" id="M000087-source"><pre>    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 40</span>
40:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">percentage_bar</span>(<span class="ruby-identifier">percent</span>)
41:     <span class="ruby-identifier">image_tag</span> <span class="ruby-value str">&quot;http://www.prosper.com/images/utilities/funding_bar.gif&quot;</span>, <span class="ruby-identifier">:alt</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;&quot;</span>, <span class="ruby-identifier">:width</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">pct</span>(<span class="ruby-identifier">percent</span>), <span class="ruby-identifier">:height</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">10</span>
42:   <span class="ruby-keyword kw">end</span></pre></div>
</div>

<a class="small" name="M000082"><br/></a>
<div class="method_block"><h3>
<a href='#M000082'>


prosper_image_url

(posting, size='thumb')

</a>
</h3>
<p>
Builds the url for a posting&#8216;s image on prosper.com
</p>

<p class="source_link" id="M000082-show-link"><a href="#" onclick="toggle('M000082-source'); toggleText('M000082-link'); return false;" id="M000082-link">Show source...</a></p><div class="source" id="M000082-source"><pre>    <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 10</span>
10:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prosper_image_url</span>(<span class="ruby-identifier">posting</span>, <span class="ruby-identifier">size</span>=<span class="ruby-value str">'thumb'</span>)
11:     <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">default_listing_image_path</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">posting</span>.<span class="ruby-identifier">primary_image_url</span>.<span class="ruby-identifier">blank?</span>
12:     <span class="ruby-identifier">slug</span>, <span class="ruby-identifier">format</span> = <span class="ruby-identifier">posting</span>.<span class="ruby-identifier">primary_image_url</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'.'</span>, <span class="ruby-value">2</span>)
13:     <span class="ruby-node">&quot;http://images.prosper.com/listing/#{posting.listing_number}/#{slug}_#{size}.#{format}&quot;</span>
14:   <span class="ruby-keyword kw">end</span></pre></div>
</div>

<a class="small" name="M000081"><br/></a>
<div class="method_block"><h3>
<a href='#M000081'>


prosper_listing_url

(posting)

</a>
</h3>
<p>
Builds the url for a posting&#8216;s listing url on prosper.com
</p>

<p class="source_link" id="M000081-show-link"><a href="#" onclick="toggle('M000081-source'); toggleText('M000081-link'); return false;" id="M000081-link">Show source...</a></p><div class="source" id="M000081-source"><pre>   <span class="ruby-comment cmt"># File app/helpers/application_helper.rb, line 5</span>
5:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prosper_listing_url</span>(<span class="ruby-identifier">posting</span>)
6:     <span class="ruby-node">&quot;http://www.prosper.com/lend/listing.aspx?listingID=#{posting.listing_number}&quot;</span>
7:   <span class="ruby-keyword kw">end</span></pre></div>
</div>





</div><div class="clear" id="footer">Generated on May 14, 2008 / Allison 2 &copy; 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html>